package com.sks.bean.pojo;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.sks.bean.user.Gender;


/**
* @ClassName: Users
* @Description: TODO(外部用户的实体类)
* @author duof duof.chen@gmail.com
* @date 2011-10-30 下午10:23:38
* 
*/
@Entity
public class Users implements Serializable {

	// Fields

	private Integer userId;
	private String loginName;
	private String familyName;
	private String loginPwd;
	private Date registerTime;
	private Gender sex;
	private String cardNo;
	private String mobile;
	private String email;
	private Boolean status;
	private String address;
	private Date lastUpdateTime;
	private Integer userType;
	private Date changePwdTime;
/*	private List houses = new ArrayList(0);
	private List comments = new ArrayList(0);
	private List userPurviews = new ArrayList(0);*/

	// Constructors

	/** default constructor */
	public Users(){
		
	}
	
	public Users(String loginName, String loginPwd, String email) {
		this.loginName  = loginName;
		this.loginPwd = loginPwd;
		this.email = email;
	}
	

	/** minimal constructor */
	public Users(String loginName, String loginPwd, String familyName, Timestamp registerTime,
			String mobile, String email, Boolean status,
			Timestamp lastUpdateTime) {
		this.loginName = loginName;
		this.familyName = familyName;
		this.loginPwd = loginPwd;
		this.registerTime = registerTime;
		this.mobile = mobile;
		this.email = email;
		this.status = status;
		this.lastUpdateTime = lastUpdateTime;
	}

	/** full constructor */
	public Users(String loginName, String familyName, String loginPwd, Timestamp registerTime,
			Gender sex, String cardNo, String mobile,
			String email, Boolean status, String address,
			Timestamp lastUpdateTime, Integer userType
			) {
		this.loginName = loginName;
		this.familyName = familyName;
		this.loginPwd = loginPwd;
		this.registerTime = registerTime;
		this.sex = sex;
		this.cardNo = cardNo;
		this.mobile = mobile;
		this.email = email;
		this.status = status;
		this.address = address;
		this.lastUpdateTime = lastUpdateTime;
		this.userType = userType;
		/*this.houses = houses;
		this.comments = comments;
		this.userPurviews = userPurviews;*/
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "userId", unique = true, nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(length=20)
	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	@Column(length=20)
	public String getFamilyName() {
		return familyName;
	}

	public void setFamilyName(String familyName) {
		this.familyName = familyName;
	}

	@Column(length=32,nullable=false)
	public String getLoginPwd() {
		return this.loginPwd;
	}

	public void setLoginPwd(String loginPwd) {
		this.loginPwd = loginPwd;
	}

	@Temporal(TemporalType.TIMESTAMP) @Column(nullable=false)
	public Date getRegisterTime() {
		return this.registerTime;
	}

	public void setRegisterTime(Date registerTime) {
		this.registerTime = registerTime;
	}

	@Enumerated(EnumType.STRING) @Column(nullable=false,length=5)
	public Gender getSex() {
		return this.sex;
	}

	public void setSex(Gender sex) {
		this.sex = sex;
	}

	@Column(length=8)
	public String getCardNo() {
		return this.cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	@Column(length=20)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(length=50,nullable=false)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(nullable=false)
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	@Column(length=50,nullable=true)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Temporal(TemporalType.TIMESTAMP) @Column(nullable=false)
	public Date getLastUpdateTime() {
		return this.lastUpdateTime;
	}

	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}
	
	@Column(length=32,nullable=true)
	public Integer getUserType() {
		return this.userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	@Temporal(TemporalType.TIMESTAMP) @Column(nullable=true)
	public Date getChangePwdTime() {
		return changePwdTime;
	}

	public void setChangePwdTime(Date changePwdTime) {
		this.changePwdTime = changePwdTime;
	}

	
	/*public List getHouses() {
		return this.houses;
	}

	public void setHouses(List houses) {
		this.houses = houses;
	}

	public List getComments() {
		return this.comments;
	}

	public void setComments(List comments) {
		this.comments = comments;
	}

	public List getUserPurviews() {
		return this.userPurviews;
	}

	public void setUserPurviews(List userPurviews) {
		this.userPurviews = userPurviews;
	}*/

}